﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="Vmago.Models.DBML" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
<style type="text/css">
    table._F_MC_Table
    {
        width: 900px;
        background-repeat: repeat-y;
        background-position: right;
    }
    ._F_MC_Table thead
    {
    }
    ._F_MC_Table tbody
    {
    	vertical-align:top;
    }
    ._F_MC_Table a
    {
    	font-weight:bold;
    	color:Blue;    	
    }    
    ._F_MC_Table tfoot
    {
        text-align:right;
    }
</style>
<% List<vw_recArea> oRecCitys = (List<vw_recArea>)ViewData["RecCity"];
   Int32 intPageCount = 0;
   Int32.TryParse(ViewData["PageCount"].ToString(), out intPageCount);
    %>
<table class="_F_MC_Table" border="0" cellspacing="20" cellpadding="5">
    <thead>
        <tr>
            <td colspan="4">
            </td>
        </tr>
    </thead>
    <tbody>
        <%for (Int32 i = 0; i < oRecCitys.Count; i++) { %>
            <%if (i % 2 == 0) {%><tr><% } %>
                <td>
                    <%=Html.Image(String.Format("../..{0}/{1}",oRecCitys[i].folder,oRecCitys[i].fileName),oRecCitys[i].Name,100, 100)%>
                </td>
                <td>
                    <div style=" width:100%; text-align:left">
                    <a><%=Html.Encode(oRecCitys[i].Name)%></a>
                    </div>
                    <br />
                    <%if(oRecCitys[i].description.Length>100){ %>
                        <%=Html.Encode(oRecCitys[i].description.Substring(0,100)+"...") %>
                    <% } %>
                    <%else{ %>
                        <%=Html.Encode(oRecCitys[i].description) %>
                    <% } %>
                    <br />
                    <div style=" width:100%; text-align:right">
                        <%=Html.ActionLink("详细信息", String.Format("../City/CityDetail/{0}", oRecCitys[i].ID))%>                      
                    </div>
                </td>
            <%if (i % 2 == 1) {%></tr><% } %>
        <%} %>        
    </tbody>
    <tfoot>
        <tr>        
            <td colspan="4">
                <table>
                    <tr>
                    <%for (Int32 i = 1; i <= intPageCount; i++)
                      {%>
                        <td>
                            <%if(!this.ViewContext.RouteData.Values["id"].Equals(i.ToString())){ %>
                            <%=Html.ActionLink(i.ToString(),String.Format("MoreCity/{0}",i)) %>
                            <%} %>
                            <%else{%>
                            <b><%=Html.Encode(i) %></b>
                            <%} %>
                        </td>
                    <% }  %>                    
                    </tr>
                </table>
            </td>
        </tr>
    </tfoot>
</table>
</asp:Content>
